export const lhx_showModal = () => {
  return new Promise(resolve => {
    wx.showModal({
      title: '温馨提示',
      content: '您确定要从购物车删除商品吗?',
      showCancel: true,
      cancelText: '取消',
      cancelColor: '#000000',
      confirmText: '确定',
      confirmColor: '#3CC51F',
      success: resolve
    })
  })
}
var util = {
	navigate: function(option) {
		let arr = option.split(':')
		let type = arr[0]
		let url = ''
		if(arr.length == 2) {
			url = arr[1]
		} else {
			url = type
		}
		if(type == 'redirectTo') {
			uni.redirectTo({
			    url: url
			});
		} else if(type == 'switchTab') {
			uni.switchTab({
			    url: url
			});
		} else {
			uni.navigateTo({
			    url: url,
					success: function(e) {

					},
					fail: function(e) {
						uni.redirectTo({
								url: url
						});
					}
			});
		}
	}
}
export {util}